package com.alstudio.net.protocol.xmpp.parser.iq;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import com.alstudio.net.callback.XmppEventListener;
import com.alstudio.net.protocol.xmpp.XmlReader;
import com.alstudio.net.protocol.xmpp.packact.IQ;
import com.alstudio.utils.Mylog;

public class FeedBackIQPackactParser extends BaseIQParser{

	@Override
	public void parseIQPackage(IQ packact,String stream,XmppEventListener listener) throws IOException {
		// TODO Auto-generated method stub
		Mylog.d(TAG,"start parsing feedback iq result...");
		mReader = new XmlReader(new ByteArrayInputStream(stream.getBytes()));

		while(true)
		{
			mReader.next();				
			String tagname = mReader.getName();
			if (tagname != null) {
				if ((mReader.getType() == XmlReader.START_TAG) && tagname.equals("query")) {
				}
				else if ((mReader.getType() == XmlReader.END_TAG) && tagname.equals("iq"))
				{
					break;
				}
			}				
		}
		
		Mylog.d(TAG,"feedback iq result parsed");
	}

}
